#include<stdio.h>
double f( int n,double x);

 int main(){
double x; int n;
printf("Enter n x");
scanf("%d%lf",&n,&x);
printf("n:%d,x:%lf,result:%lf ",n,x,f(n,x));
getchar();
return 0;
}

double f( int n,double x){
    if(n==0){
       return 1.0;
    }
    else if(n<0){
       return f( -n,1/x);
    }
    else if(n%2==0){
        double a=f(n/2,x);
        return a*a;
    }
    else {double a=f(n/2,x);
    return x*a*a;
    }
    
}
